import redis
from loguru import logger
from cmreslogging.handlers import CMRESHandler
import pymongo


pool = redis.ConnectionPool(host='192.168.2.117', port=6380, decode_responses=True)
handler = CMRESHandler(hosts=[{'host': '192.168.2.117', 'port': 9200}],
                           auth_type=CMRESHandler.AuthType.NO_AUTH,
                           # host = 'imac',
                           es_index_name="ershoufang_log")

# logger.add("1.log")
# 日志写入elasticsearch 由kibana分析
logger.add(handler)
logger.debug('this is a debug message')


client = pymongo.MongoClient("192.168.2.117")
db = client['beike_house']

